﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace X3DXNA.basicModels
{
    public struct VertexPositionNormalColor : IVertexType
    {
        Vector3 vertexPosition;
        Vector3 vertexNormal;
        Color vertexColor;

        public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration
        (
            new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
            new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),
            new VertexElement(24, VertexElementFormat.Color, VertexElementUsage.Color, 0)
        );

        public VertexPositionNormalColor(Vector3 position, Vector3 normal, Color color)
        {
            vertexPosition = position;
            vertexNormal = normal;
            vertexColor = color;
        }

        public Vector3 Position
        {
            get { return vertexPosition; }
            set { vertexPosition = value; }
        }

        public Vector3 Normal
        {
            get { return vertexNormal; }
            set { vertexNormal = value; }
        }

        public Color Color
        {
            get { return vertexColor; }
            set { vertexColor = value; }
        }

        VertexDeclaration IVertexType.VertexDeclaration
        {
            get { return VertexDeclaration; }
        }
    }
}
